package com.siyue.config;

import org.apache.catalina.WebResourceRoot;
import org.apache.catalina.connector.Connector;
import org.apache.tomcat.websocket.server.WsContextListener;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.embedded.tomcat.TomcatWebServer;
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//@Configuration
public class TomcatConfig {

//    @Bean
//    public ServletWebServerFactory servletContainer() {
//        TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory() {
//            protected void customizeConnector(Connector connector) {
//                super.customizeConnector(connector);
//                // 设置最大空闲时间为5分钟
//                connector.setAttribute("socket.soTimeout", 300000);
//                connector.setAttribute("connectionTimeout", 300000);
//            }
//        };
//        return factory;
//    }
}